<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // 写一个函数 `checkSpam(str)`，如果 `str` 包含 `javascript` 或 `html` 就返回 `true`，否则返回 `false`。
        function checkSpam(str) {
            var str1 = str.toLowerCase();
            var str2 = str1.split(' ');
            // return str2;
            // return str1;
            if (str2.indexOf('javascript') !== -1 || str2.indexOf('html') !== -1) {
                return true;
            } else {
                return false;
            }
        }
        var str1 = 'JavaScript is the best develop language';
        var str2 = 'hello world'; // false
        console.log(checkSpam(str1));
        console.log(checkSpam(str2));
    </script>
</body>

</html>